<template>
    <div>
        <van-nav-bar title="首页" />
        <van-search v-model="value" shape="round" background="#4fc08d" placeholder="请输入搜索关键词" />
        <van-swipe :autoplay="3000" lazy-render>
            <van-swipe-item v-for="image in images" :key="image">
                <img :src="image" style="width:80%; height: 220px;" />
            </van-swipe-item>
        </van-swipe>
        <van-grid :column-num="3">
            <van-grid-item v-for="item in mz" :icon="item.image_src
"  :text="item.name" />
        </van-grid>
      


    </div>
</template>

<script setup>
import {catitemsApi} from '@/api/api'
import { ref } from 'vue';
let mz=ref([])
catitemsApi().then(res=>{
    console.log(res)
    mz.value=res.data.message

})
const images = [
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-3.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-4.jpeg',
];

</script>

<style lang="scss" scoped></style>